<?php
class AdminFooterWidget  extends CWidget{
    
	//输出字符串
	private $out = '';
    
    private $controller= '';
    
    private $action= '';

	public function init(){
        $this->controller = Yii::app()->controller->id;  
        $this->action = Yii::app()->controller->action->id; 
	}

	public function run(){
        $this->generateFooter();
		echo $this->out;
	}
    
    public function generateFooter(){
        $baseScript = Yii::app()->request->baseUrl;
        $titleString = CHtml::encode(Yii::app()->name);
        $descriptionString = CHtml::encode(Yii::app()->params['description']);
        $siteAddressString = CHtml::encode(Yii::app()->params['siteAddress']);
        $emailString = CHtml::encode(Yii::app()->params['adminEmail']);
        
        $this->out .= <<<OUT
                <footer>
                    <div class="container-fluid">
                        <div class="row-fluid">
                            <div class="span12">
                                <h3 class="footer-title">后台管理 - {$titleString}</h3>
                                联系邮箱: <a href="mailto:{$emailString}" target="_blank">{$emailString}</a>
                                <p>&COPY; {$titleString} 2013</p>
                            </div> <!-- /span12 -->
                        </div>
                    </div>
                </footer>
OUT;
    }
}


